home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2006 May / PCWMAY06.iso / Software / Freeware / First Page 2006 3.00 / fp2006-final-3.00-setup.exe / {app} / Iscripts / Form & Validation / char-count.izs < prev    next >
Text File  |  2005-08-29  |  2KB  |  79 lines

  1. <!NOWIZARD>
  2.  
  3. <!TITLE>Character count
  4. <!/TITLE>
  5.  
  6. <!DESCRIPTION>Calculate and display the number of characters within a TEXTAREA with this script. Useful, for example, in helping your visitors manually keep their input length in check!
  7.  
  8. <!/DESCRIPTION> 
  9.  
  10. <!CATEGORY>form and form validation<!/CATEGORY>
  11.  
  12. <!SCRIPT>
  13. <!-- START OF SCRIPT -->
  14. <form method="POST">
  15.  
  16. <table border="0" cellspacing="0" cellpadding="0">
  17.     <tr>
  18.       <td width="100%">
  19. <textarea rows="12" name="charcount" cols="60" wrap="virtual"></textarea>
  20.       </td>
  21.     </tr>
  22.     <tr>
  23.       <td width="100%"><div align="right"><p><input type="button" value="Calculate Characters"
  24.       onClick="countit(this)"> <input type="text" name="displaycount" size="20"></p>
  25.       <div align="center"><center><p><font face="arial" size="-2">This free script provided by</font>
  26.       <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
  27.       Kit</a></font></p>
  28.       </center></div></div></td>
  29.     </tr>
  30.   </table>
  31.  
  32. </form>
  33.  
  34. <script language="JavaScript">
  35.  
  36. function countit(what){
  37.  
  38. formcontent=what.form.charcount.value
  39. what.form.displaycount.value=formcontent.length
  40. }
  41. </script>
  42. <!-- END OF SCRIPT -->
  43. <!/SCRIPT>
  44.  
  45. <!PREVIEW>
  46. <!-- START OF SCRIPT -->
  47.  
  48. <form method="POST">
  49.  
  50. <table border="0" cellspacing="0" cellpadding="0">
  51.     <tr>
  52.       <td width="100%">
  53. <textarea rows="12" name="charcount" cols="60" wrap="virtual"></textarea>
  54.       </td>
  55.     </tr>
  56.     <tr>
  57.       <td width="100%"><div align="right"><p><input type="button" value="Calculate Characters"
  58.       onClick="countit(this)"> <input type="text" name="displaycount" size="20"></p>
  59.       <div align="center"><center><p><font face="arial" size="-2">This free script provided by</font>
  60.       <font face="arial, helvetica" size="-2"><a href="http://javascriptkit.com">JavaScript
  61.       Kit</a></font></p>
  62.       </center></div></div></td>
  63.     </tr>
  64.   </table>
  65.  
  66. </form>
  67.  
  68. <script language="JavaScript">
  69.  
  70. function countit(what){
  71.  
  72. formcontent=what.form.charcount.value
  73. what.form.displaycount.value=formcontent.length
  74. }
  75. </script>
  76. <!-- END OF SCRIPT -->
  77. <!/PREVIEW>
  78.  
  79. <!RELATED>NONE<!/RELATED>